# condition

# 是否成年
age = 7
print('年龄为:', age)
if age >= 18:
    print('成年')
elif age >= 12:
    print('少年')
else:
    print('儿童')

# 只要age是非零数值、非空字符串、非空list等，就判断为True
if age:
    print(age)

# 类型转换
str12 = '12'
num12 = int(str12)
print(num12 + 1)


# 练习：计算BMI指数
height = input('身高:')
weight = input('体重:')
height = float(height)
weight = float(weight)
bmi = weight / height ** 2
print('bmi: %2f' % bmi)
if bmi < 18.5:
    print('过轻')
elif bmi < 24:
    print('正常')
elif bmi < 28:
    print('过重')
elif bmi < 32:
    print('肥胖')
else:
    print('严重肥胖')
